﻿using System.Media;
using System.Threading;

namespace OnlineStore.Common
{
    internal static class Music
    {
        public static void PlaySystemMusic(int count)
        {
            for (int i = 0; i < count; i++)
            {
                SystemSounds.Asterisk.Play();
                Thread.Sleep(800);
            }
        } 

        public static void PlaySystemMyMusic(int count) 
        {
            SoundPlayer player = new SoundPlayer();
            for (int i = 0; i < count; i++)
            {
                player.SoundLocation = @".\Music\tipSound_1.wav";
                player.Load(); //同步加载声音
                player.Play(); //启用新线程播放
                Thread.Sleep(1800);
            }
            player.Dispose();
        }
    }
}
